"use strict";
/*
 * @Author: your name
 * @Date: 2020-07-22 12:10:15
 * @LastEditTime: 2020-07-22 14:53:29
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \knowledge\TS\helloword.ts
 */
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
// function run():string{
//     return "string";
// }
// console.log(run());
// function getInfo(name:string,age:number):string{
//     return `${name}-${age}`
// }
// // console.log(getInfo('lihao',18));
// function getInfo2(name:string,age?:number):string{
//     return `${name}-${age==undefined?'保密':age}`
// }
// console.log(getInfo2('lihao',18));
// console.log(getInfo2('lihao2'));
//  console.log(1111111);
// class Person{
//     // 属性
//     name:string;   
//     // 构造函数 实例化类的时候 触发的方法
//     constructor (name:string){
//         this.name = name;
//     };
//     getName():string{
//         return `I am ${this.name}`
//     }
//     setName(name:string){
//         this.name = name
//     }
// };
// var person = new Person('bobo');
// console.log(person.getName())
// person.setName("tttt")
// console.log(person.getName())
var Car = /** @class */ (function () {
    // 构造函数 实例化类的时候 触发的方法
    function Car(name) {
        this.name = name;
    }
    ;
    Car.prototype.run = function () {
        return this.name + "running!";
    };
    return Car;
}());
;
var BMW = /** @class */ (function (_super) {
    __extends(BMW, _super);
    function BMW(name) {
        return _super.call(this, name) || this;
    }
    return BMW;
}(Car));
var b = new BMW('320');
console.log(b.run());
// public protected private
// static
